BootApplication.controller("HeadController",
				["configuration", "$scope", "$rootScope", "$translate", "$timeout", "$http","$location","$mdDialog",
		 function(config, 		   $scope, 	 $rootScope,   $translate,   $timeout,   $http,  $location,  $mdDialog) {
		
	$rootScope.location = $location;
		
	$scope.showAlert = function(ev) {
		$mdDialog.show(
			      $mdDialog.alert()
			        .parent(angular.element(document.querySelector('#popupContainer')))
			        .clickOutsideToClose(true)
			        .title('Info')
			        .textContent('Ricerca salvata nei preferiti')
			        .ariaLabel('Alert Dialog Demo')
			        .ok('OK')
			        .targetEvent(ev)
			    );
	};
	
}]).directive("scroll", function ($window) {
    return function(scope, element, attrs) {
        angular.element($window).bind("scroll", function() {
             if (this.pageYOffset >= 1) {
                 scope.boolChangeClass = true;
             } else {
                 scope.boolChangeClass = false;
             }
            scope.$apply();
        });
    };
}).filter("trust", ['$sce', function($sce) {
	return function(htmlCode){
		return $sce.trustAsHtml(htmlCode);
	}
}]);